package com.itmk.student.service.impl;

import com.itmk.student.dao.StudentDao;
import com.itmk.student.dao.impl.StudentDaoImpl;
import com.itmk.student.entity.Student;
import com.itmk.student.entity.StudentParm;
import com.itmk.student.entity.StudentPointsVo;
import com.itmk.student.entity.StudentVo;
import com.itmk.student.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    private StudentDao studentDao = new StudentDaoImpl();
    @Override
    public void add(Student student) {
        studentDao.add(student);
    }

    @Override
    public List<StudentVo> list(StudentParm studentParm) {
        return studentDao.list(studentParm);
    }

    @Override
    public int getCount(StudentParm studentParm) {
        return studentDao.getCount(studentParm);
    }

    @Override
    public Student getById(String stuId) {
        return studentDao.getById(stuId);
    }

    @Override
    public void updateById(Student student) {
        studentDao.updateById(student);
    }

    @Override
    public void deleteById(String stuId) {
        studentDao.deleteById(stuId);
    }

    @Override
    public Student login(String stuNum, String password) {
        return studentDao.login(stuNum,password);
    }

    @Override
    public List<StudentPointsVo> pointList(StudentParm parm) {
        return studentDao.pointList(parm);
    }

    @Override
    public int pointCount(StudentParm parm) {
        return studentDao.pointCount(parm);
    }

    @Override
    public int getTotal() {
        return studentDao.getTotal();
    }

    @Override
    public Student getUserByPas(int userId, String password) {
        return studentDao.getUserByPas(userId,password);
    }

    @Override
    public void updatePassword(int userId, String password) {
        studentDao.updatePassword(userId,password);
    }
}
